<template>
  <div >
    <mt-popup v-model="deleterep" class="delete-header-popup" modal="false">
      <div style="width: 6.2rem;height: 2.4rem;">
        <div class="repdelete">
          <span class="noshenhe" v-if="type==1">确定删除？</span>
          <div class="shenhe" v-else-if="type==2">您的评论已被平台选为优质，需管理员审核后才能删掉，仍要删除吗？</div>
          <div class="shenhe" v-else-if="type==3">{{poptext}}</div>
          <div class="shenhe" v-else-if="type==4">
            <p>补签说明</p>
            <p>{{poptext}}</p> 
          </div>
          <div class="noshenhe" v-else>{{poptext}}</div> 
        </div>
        <div class="rep-bottom">
          <div class="cancle-sep" @click="cancledelete($event)" v-if="showcancle">取消</div>
          <div class="queding" @click="ok($event)">确定</div>
        </div>
      </div>
    </mt-popup>
  </div>
</template>
<script>
  export default{
    data(){
      return{
        deleterep: false
      }
    },
    watch: {
      isshowdeletepopup(val, oldval){
        this.deleterep = this.isshowdeletepopup;
      },
      deleterep(val,oldval){
        this.deleterep = val;
        this.$emit("deleteshow",this.deleterep);
      }
    },
    // props:['isshowdeletepopup','type','poptext','showcancle'],
    props:{
      isshowdeletepopup: {
        type: Boolean,
        default: false
      },
      type: {
        type: Number,
        default: 0
      },
      poptext: {
        type: String,
        default: ''
      },
      showcancle: {
        type: Boolean,
        default: true
      },
    },
    methods:{
      cancledelete(event){
        this.$emit("cancledelete",{event:event})
      },
      ok(event){
        this.$emit("candelete",{event:event})
      }
    }
  }
</script>
<style>
  .delete-header-popup{
    border-radius: 0.1rem;
  }

  .repdelete{
    height:1.5rem;
    align-items: center;
    text-align: center;
    font-size: 0.32rem;
    font-family: "PingFangSC Regular";
    color: #333333;
    /* padding: 0 0.1rem; */
    display: flex;
    flex-direction: column;
  }
  .shenhe{
    margin-top: 0.3rem;
  }
  .noshenhe{
    margin-top: 0.5rem;
  }
  .rep-bottom{
    border-top: 1px solid #d1d1d1;
    display: flex;
    color: #fb685b;
    font-size: 0.32rem;
  }
  .cancle-sep{
    border-right: 1px solid #d1d1d1;
    flex: 1;
    height: 0.89rem;
    text-align: center;
    line-height: 0.89rem;
  }
  .queding{
    flex: 1;
    height: 0.89rem;
    text-align: center;
    line-height: 0.89rem;
  }
</style>
